package ooday02;
//重写的演示
public class OverrideDemo {
    public static void main(String[] args) {
        //重写方法被调用时,看对象的类型执行方法
        Student zg = new Student("张光",25,"山东烟台","jsd2312","001");
        zg.sayHi();// 调用Student重写之后的
        Teacher wkj = new Teacher("王克晶",39,"北京",25000.0);
        wkj.sayHi();//调用Teacher重写之后的
        Doctor ch = new Doctor("陈汉",45,"重庆","主任医师");
        ch.sayHi();//调用Person中的
    }
}

